var a = getApp();

Page({
    data: {
        listDatas: [],
        pageNo: 1,
        pageSize: 20
    },
    loadData: function(t) {
        var o = this, n = o.data.pageNo;
        if (t) n = 1; else if (o.data.total == o.data.listDatas.length) return;
        a.network.post({
            url: a.url.fansList,
            params: {
                pageNo: n,
                pageSize: 10
            },
            before: function() {
                wx.showNavigationBarLoading();
            },
            success: function(e) {
                if (1 == e.data.result) {
                    var i = [];
                    t || (i = o.data.listDatas), i = i.concat(e.data.data.users), console.log(i), n += 1, 
                    o.setData({
                        total: e.data.data.total,
                        listDatas: i,
                        pageNo: n
                    });
                } else a.util.showToast(e.data.message);
            },
            fail: function() {
                a.util.showToast("获取数据失败");
            },
            complete: function() {
                wx.hideNavigationBarLoading(), wx.stopPullDownRefresh();
            }
        });
    },
    tapItem: function(t) {
        var o = t.currentTarget.dataset.accesstoken;
        a.util.navToUserHome(o);
    },
    onLoad: function(a) {
        this.loadData(!0);
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {
        this.loadData(!0);
    },
    onReachBottom: function() {
        this.loadData(!1);
    },
    onShareAppMessage: function() {
        return {
            title: a.globalData.commonShareTitle,
            path: a.globalData.commonSharePath,
            imageUrl: a.globalData.commonShareImage,
            success: function(a) {},
            fail: function(a) {}
        };
    }
});